package com.example.clientbwic.controller;

import com.example.clientbwic.entity.Bid;
import com.example.clientbwic.service.bid.BidService;
import com.example.clientbwic.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 86150
 * @Date: 2024/4/13
 * @Description: com.example.clientbwic.controller
 */
@RestController
public class BidController {
    @Autowired
    BidService bidService;
    /**
    * @Description: 获取对应bwic的所有bid
    */
    @GetMapping("/bid/{bwicId}")
    public Result<List<Bid>> getBidsByBwicId(@PathVariable Long bwicId){
        List<Bid> bids = bidService.getBidsByBwicId(bwicId);
        return Result.success(bids);
    }
}
